import request from '@/utils/request'

export async  function   getSitesByParking(parkingId) {
  let res =  await request({
    url: '/Sites?$filter=ParkingId eq '+parkingId,
    method: 'get',
  })
  return res.data.value;
}
export async function updateSite(site){
  let res =  await request({
    url: `/Sites(${site.SiteId})`,
    method: 'put',
    data: site
  })
  return res.data.value;
}
export async function addSite(site){
  //
  let res =  await request({
    url: '/Sites',
    method: 'post',
    data: site,
  })
  return res.data;
}
export function removeSite(id){
  return request({
    url: `/sites/${id}`,
    method: 'delete',
  })
}
